package com.ace.model.bo;

/***********************************************************************
 * Module:  RefPrix.java
 * Author:  a.kanwar
 * Purpose: Defines the Class RefPrix
 ***********************************************************************/

import java.util.*;


public class RefPrix {

      
   /********************************************************************
    * Attribute
    *********************************************************************/
    
   private int idRefPrix;
   private float prixCotisation;
   private Float fraisDossier; 
   private java.util.Collection<Contrat> contrat;
  
   
      
   /********************************************************************
    * Constructor
    *********************************************************************/
   
   public RefPrix(int idRefPrix, float prixCotisation, Float fraisDossier, Collection<Contrat> contrat) {
        this.idRefPrix = idRefPrix;
        this.prixCotisation = prixCotisation;
        this.fraisDossier = fraisDossier;
        this.contrat = contrat;
   }

    public RefPrix(float prixCotisation, Float fraisDossier, Collection<Contrat> contrat) {
        this.prixCotisation = prixCotisation;
        this.fraisDossier = fraisDossier;
        this.contrat = contrat;
    }
   
      
   /********************************************************************
    * Getters and setters
    *********************************************************************/
    
   public int getIdRefPrix() {
      return idRefPrix;
   }

    public void setIdRefPrix(int idRefPrix) {
        this.idRefPrix = idRefPrix;
    }

    public float getPrixCotisation() {
        return prixCotisation;
    }

    public void setPrixCotisation(float prixCotisation) {
        this.prixCotisation = prixCotisation;
    }

    public Float getFraisDossier() {
        return fraisDossier;
    }

    public void setFraisDossier(Float fraisDossier) {
        this.fraisDossier = fraisDossier;
    }

   public java.util.Collection<Contrat> getContrat() {
      if (contrat == null)
         contrat = new java.util.HashSet<Contrat>();
      return contrat;
   }
   
   
      
   /********************************************************************
    * generate code by power AMC
    *********************************************************************/
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator getIteratorContrat() {
      if (contrat == null)
         contrat = new java.util.HashSet<Contrat>();
      return contrat.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newContrat */
   public void setContrat(java.util.Collection<Contrat> newContrat) {
      removeAllContrat();
      for (java.util.Iterator iter = newContrat.iterator(); iter.hasNext();)
         addContrat((Contrat)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newContrat */
   public void addContrat(Contrat newContrat) {
      if (newContrat == null)
         return;
      if (this.contrat == null)
         this.contrat = new java.util.HashSet<Contrat>();
      if (!this.contrat.contains(newContrat))
      {
         this.contrat.add(newContrat);
         newContrat.setRefPrix(this);      
      }
   }
   
   /** @pdGenerated default remove
     * @param oldContrat */
   public void removeContrat(Contrat oldContrat) {
      if (oldContrat == null)
         return;
      if (this.contrat != null)
         if (this.contrat.contains(oldContrat))
         {
            this.contrat.remove(oldContrat);
            oldContrat.setRefPrix((RefPrix)null);
         }
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllContrat() {
      if (contrat != null)
      {
         Contrat oldContrat;
         for (java.util.Iterator iter = getIteratorContrat(); iter.hasNext();)
         {
            oldContrat = (Contrat)iter.next();
            iter.remove();
            oldContrat.setRefPrix((RefPrix)null);
         }
      }
   }

}